#pragma once

#include<memory>
#include"myMiniEngine/Core.h"

#include"spdlog/spdlog.h"
#include"spdlog/sinks/stdout_color_sinks.h"
#include"spdlog/fmt/ostr.h"


namespace myMiniEngine{
	class  Log
	{
	public:
		static void Init();

		inline static Ref<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		inline static Ref<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }

	private:
		static Ref<spdlog::logger> s_CoreLogger;
		static Ref<spdlog::logger> s_ClientLogger;


	};

}


//Core log
#define MGE_CORE_TRACE(...)    ::myMiniEngine::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define MGE_CORE_INFO(...)     ::myMiniEngine::Log::GetCoreLogger()->info(__VA_ARGS__)
#define MGE_CORE_WARN(...)     ::myMiniEngine::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define MGE_CORE_ERROR(...)    ::myMiniEngine::Log::GetCoreLogger()->error(__VA_ARGS__)
#define MGE_CORE_CRITICAL(...) ::myMiniEngine::Log::GetCoreLogger()->critical(__VA_ARGS__)

//Client log
#define MGE_TRACE(...)         ::myMiniEngine::Log::GetClientLogger()->trace(__VA_ARGS__)
#define MGE_INFO(...)          ::myMiniEngine::Log::GetClientLogger()->info(__VA_ARGS__)
#define MGE_WARN(...)          ::myMiniEngine::Log::GetClientLogger()->warn(__VA_ARGS__)
#define MGE_ERROR(...)         ::myMiniEngine::Log::GetClientLogger()->error(__VA_ARGS__)
#define MGE_CRITICAL(...)      ::myMiniEngine::Log::GetClientLogger()->critical(__VA_ARGS__)




